<?php

/*
 * Action - 5$
 *
 * +1 card 
 * +1 action
 * take coin token
 * setup: every player takes a coin token
 */

class Baker extends Card implements iAction, iKingdom, iGuilds, iCoinTokensRequired {

    public function __construct() {
        parent::__construct("Baker", 5);
        $this->undoPlay = false;
        $this->undoBuy = false;
    }
    
    public function getDescription() {
        return array(
            "+1 card",
            "+1 action",
            "Take a coin token",
            "setup: Each player takes a coin token"
        );
    }
    
    public function boardSetup(Game $game) {
        $names = $game->getPlayersNames();
        foreach ($names as $name) {
            $game->addCoinTokens(1, $name);
        }
        return true;
    }

    public function play(Game $game, $isRealCard) {
        $drawed_cards = $game->drawCards(1);
        $game->addActions(1);
        $game->addCoinTokens(1);
        ScreenDisplay::addScreenMessage($game, true, "get +1 action, +1 coin token and draw " . nicePrint($drawed_cards), "get +1 action, +1 coin token and draws " . sizeof($drawed_cards) . " cards");
        
        $game->cardActionFinished();
        return true;
    }

}

?>